import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class TestForHashMap extends Main {
    HashMap<Integer, String> map = new HashMap<Integer, String>();

    void Test() {
        String textInFileWork = textInFile;
        int numberTrimInTextInFile = textInFileWork.split(" ").length;
        for (int i = 0; i < numberTrimInTextInFile; i++) {
            map.put(i, textInFileWork.substring(0, textInFileWork.indexOf(" "))); // list add substring first word.
            textInFileWork = textInFileWork.substring(textInFileWork.indexOf(" ") + 1); // delete first word and return all record.
        }
        System.out.println("this info from HachMap");
        System.out.println("first list" + map);
        System.out.println("<3 " + buildListFromLetterLess3());
        System.out.println("gl " + buildListFromWordHaveGL());


        //    getMap();
        //    keySet();
        //   mapValues();
        //   mapSize();
        //    deleteElement();
    }

    private ArrayList buildListFromWordHaveGL() {
        ArrayList<String> listFromWordHaveGL = new ArrayList<String>();
        Pattern pattern = Pattern.compile("[аоэиуыеёюя]");
        for (int i = 0; i < map.size(); i++) {
            Matcher matcher = pattern.matcher(map.get(i));
            if (matcher.find()) {
                listFromWordHaveGL.add(map.get(i));
            }
        }

        return listFromWordHaveGL;
    }


    private ArrayList buildListFromLetterLess3() {
        ArrayList<String> listFromLetterLess3 = new ArrayList<String>();
        for (int i = 0; i < map.size(); i++) {
            if (map.get(i).length() < 4) {
                listFromLetterLess3.add(map.get(i));
            }
        }

        return listFromLetterLess3;
    }

    private void deleteElement() {
        // System.out.println("!!!3 " + map.remove("c"));
    }

    private void mapSize() {
        System.out.println("size " + map.size());
    }

    private void mapValues() {
        System.out.println("all values " + map.values());
    }

    private void keySet() {
        System.out.println("all key " + map.keySet());
    }


    void getMap() {

        ArrayList<String> list = new ArrayList<String>();
        list.add(map.get(1));
        list.add(map.get(2));
        list.add(map.get(3));


    }
}
